<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.lsms.dao.impl.*" %>
<%@ page import="org.lsms.bean.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>Reviewer Paper Reviewing Page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="LSMS,ICSEE,REVIEWER">
	
	<link rel="stylesheet" type="text/css" href="../css/author_layout.css">
	<link rel="stylesheet" type="text/css" href="../css/hyper_link_style.css">
	
	<style type="text/css">
	
	td{
		text-align:center;
	}
	
	</style>
	
  </head>
  
  <body>
	<div id="container">
		<div id="header" class="logo_image"></div>
		<div class="nav"></div>
		<div id="author_menu" class="border">
			<table border="0" width="100%"  >
				<tr>
					<td  bgcolor="#CCCCCC"><a href="../index.jsp">Home</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="select_topic.jsp">Select Topics</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="paper_review.jsp">Paper Reviewer</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="modify_info.jsp">Modify Information</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="../logout">Log Out</a></td>
				</tr>
			</table>
		</div>
		
		<div id="content" class="bg_color border">
			<div style="margin:15px">
			<p align="center"><b>Paper Review</b></p>
				<div id="paper_review">
				<table align="center" border="0" style="width:650px">
				<tr>
					<th>Inviter</th>
					<th>Paper ID</th>
					<th>Author(s)</th>
					<th>Title</th>
					<th>Download</th>
					<th>&nbsp;</th>
				</tr>
				<%
					DaoImpl impl = new DaoImpl();
					HashMap<Integer,Paper> map = new HashMap<Integer,Paper>();
				 	int reviewer_id = Integer.parseInt(session.getAttribute("userid").toString());
					System.out.println(reviewer_id);
					map = impl.get_paper_assigned_to_reviewer(reviewer_id);
					Set<Integer> set = map.keySet();
					Iterator it = set.iterator();
					while(it.hasNext()){
						int paper_id = (Integer)it.next();
						Paper paper = (Paper)map.get(paper_id);
						int member_id = paper.getPaperid();
						System.out.println("Paper_id is "+paper_id);
						System.out.println("Member id is "+member_id);
						User user = impl.get_user_info(member_id);
						
				 %>
				 <tr>
				 	<td>
				 	<%
				 		out.print(user.getLoginname());
				 	 %>
				 	</td>
				 	<td>
				 	<%
				 		out.print(paper_id);
				 	 %>
				 	</td>
				 	<td>
				 	<%
				 		out.print(paper.getAuthorname());
				 	 %>
				 	</td>
				 	<td>
				 	<%
				 		out.print(paper.getPapertitle());
				 	 %>
				 	</td>
				 	<td>
				 	<%
				 		String savename = "..";
				 		String s = impl.get_paper_sava_name(paper_id);
				 		savename +=s;
				 	 %>
				 	 <a href=<%=savename %>>Download</a>
				 	</td>
				 	<td>
				 	<%
				 		int status = impl.get_paper_assign2_status(paper_id,member_id,reviewer_id);
				 		if(status==0){
				 	 %>
				 	 <a href="paper_review_detail.jsp?paper_id=<%=paper_id%>&member_id=<%=member_id%>">Reviewing</a>
				 	<%
				 		}else{
				 	 %>
				 	 <font color="red">submitted!</font>
				 	 <%
				 	 	}
				 	  %>
				 	</td>
				 </tr>
				 <%
				 	}
				  %>
				</table>
				
				</div>
			</div>
			
		</div>
		
		<div class="nav"></div>
			
		<div id="footer" class="footer_color border">
			<p align="center"><b>&copy;2010 LSMS-All Rights Reserved.</b></p>
			<p align="center"> <b>Powered by Shu.</b></p>
		</div>
	</div>
  </body>
</html>
